<?php

if(isset($_GET['id'])){
	$id = trim($_GET['id']);
	$db = new models($host,$user,$pass,$db_name);
	
	$db->select("id");
	$db->where("id='$id'");
	$question = $db->get_data("answers");
	
	if($question){
		$db->delete("answers");
		redirect("$home_url/admin/answers/?notice=delete_success");
	}else
		redirect("$home_url/admin/answers/?notice=delete_error");
}